package com.example.jk.core;

import cn.hutool.log.dialect.slf4j.Slf4jLog;

public class Log {

	public static Slf4jLog log = new Slf4jLog(Log.class);

	public static void log(String format, Object... arguments) {

		info(format, arguments);
	}

	public static void info(String format, Object... arguments) {

		StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
		if (stackTrace.length > 2) {
			String callerClassName = stackTrace[2].getClassName();
//			System.out.println("调用者的类名: " + callerClassName);
			String callerMethodName = stackTrace[2].getMethodName();
			log.info("[" + callerClassName + " : " + callerMethodName + "]   :   " + format, arguments);
			return;
		}
		log.info(format, arguments);

	}

	public static void error(String format, Object... arguments) {
		log.error(format, arguments);
	}
}
